-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add example Phoenix application #1948
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
Awesome! Can you add a note/section to the Phoenix docs linking to and flagging up this example? |
ce1e6c3
to
182ec74
Compare
✅ Deploy Preview for electric-next ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
ada8941
to
17c1d83
Compare
@magnetised nice, ta. Two niggly suggestions:
So make it a: ## Examples
### electric-phoenix
...
<HelpWanted ... So we can add multiple examples over time. Ideally with some description of what the example shows (i.e.: the scope of the integration / functionality). As per https://electric-sql.com/docs/integrations/next#examples (but actually up a heading level). |
website/docs/integrations/phoenix.md
Outdated
### electric-phoenix | ||
|
||
See the | ||
[elixir-phoenix example](https://github.com/electric-sql/electric/tree/main/examples/electric-phoenix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo on the package name.
If the example is a LiveView example, perhaps we should rename it examples/phoenix-liveview
? And then the description there and here, rather than "using Electric for cross-browser synchronisation" can be e.g.:
This is an example Phoenix LiveView application that uses
[`Electric.Phoenix.live_stream/4`](https://hexdocs.pm/electric_phoenix/Electric.Phoenix.html#live_stream/4)
to sync data from Postgres into a LiveView using
[Phoenix Streams](https://fly.io/phoenix-files/phoenix-dev-blog-streams/).
This keeps the LiveView automatically in-sync with Postgres, without having
to re-run queries or trigger any change handling yourself.
See the
[documentation](https://electric-sql.com/docs/integrations/phoenix#liveview-sync)
for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thruflo Better? b0f2a1e
(#1948)
website/docs/integrations/phoenix.md
Outdated
@@ -80,13 +80,22 @@ For more details and full documentation see [hexdocs.pm/electric_phoenix](https: | |||
|
|||
## Examples | |||
|
|||
### electric-phoenix | |||
### phoenix-liveview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks :)
Just one more tiny thing (sorry!) is this heading can now be "Phoenix LiveView".
to avoid a release dependency loop
bf06a9e
to
2159108
Compare
Examples |
@@ -80,6 +80,25 @@ This makes your LiveView applications real-time. In fact, it allows you to build | |||
|
|||
For more details and full documentation see [hexdocs.pm/electric_phoenix](https://hexdocs.pm/electric_phoenix). | |||
|
|||
## Examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one thought here is it's probably worth also mentioning the Gatekeeper auth example here, as an example using the Plug, e.g.:
### Phoenix LiveView
... as is ...
### Gatekeeper Auth
The [gatekeeper-auth](https://github.com/electric-sql/electric/tree/main/examples/gatekeeper-auth) example also contains a Phoenix application that uses [Electric.Phoenix.Plug](#...) to authorize shape access and issue shape-scoped access tokens.
Plus update the gatekeeper-auth example to use the new Electric.Phoenix apis